<?php
    header("Content-Type:text/html;charset=utf8");
    include("./libs/Smarty.class.php");
    $smarty=new Smarty();
    $mysqli=new Mysqli("localhost","root","root","siku");  
    if(mysqli_connect_error()){
		echo mysqli_connect_error();
		exit();
    }
    $sql="SELECT * FROM comment LIMIT 0,8";
    $sql2="SELECT * FROM comment";
    $result=$mysqli->query($sql);
    $result2=$mysqli->query($sql2);
    if(mysqli_num_rows($result)){
      while($row=mysqli_fetch_assoc($result)){
        $arr[]=$row;
      }
      $data=Array("count"=>1,"list"=>$arr);
    }else{
      $data=Array("count"=>0);
    }
    while($row2=mysqli_fetch_assoc($result2)){
        $arr2[]=$row2;
      }
    
    $smarty->assign("tote",$arr2);
    $smarty->assign("user",$data);
    $smarty->display("detail.tpl");